<?php
$this->pageTitle = Yii::app()->name;
$this->breadcrumbs = array('Welcome');
?>

<?php if ($translations): ?>
	<div class="span-24 append-bottom">
		<h1>Latest Translation</h1>
		<div>
			<?php $counter = 0; ?>
			<?php foreach ($translations as $translation): ?>
				<?php
				$counter++;
				$class = 'column' . ($counter == 6 ? ' last' : '');
				?>
				<div class="<?php echo $class; ?>">
					<?php
					$src = $translation->fileThumbnailUrl;
					$alt = $translation->value;
					$htmlOptions = array();
					$text = CHtml::image($src, $alt, $htmlOptions);
					$url = array(
						'translation/create',
						'languageId'=>$translation->id,
						'dialect'=>$translation->dialect,
					);
					$htmlOptions = array(
						'title'=>"$translation->dialect",
					);
					echo CHtml::link($text, $url, $htmlOptions)
					?>
				</div>
			<?php endforeach; ?>

			<div class="clear"></div>
		</div>
	</div>
<?php endif; ?>

<div class="span-7">
	<div id="sidebar">
		<?php
		if (!Yii::app()->user->isGuest && Yii::app()->user->id == 1) {
			$config = array(
				'title'=>'Admin Menu',
				'htmlOptions'=>array(
					'class'=>'append-bottom',
				)
			);
			$this->beginWidget(
				'zii.widgets.CPortlet', $config
			);
			$this->widget(
				'zii.widgets.CMenu',
				array(
				'items'=>Yii::app()->adminMenu,
				'htmlOptions'=>array(),
				)
			);
			$this->endWidget();
		}

		$config = array(
			'title'=>'Chapter',
			'htmlOptions'=>array(
				'class'=>'append-bottom',
			)
		);
		$this->beginWidget(
			'zii.widgets.CPortlet', $config
		);
		$this->widget(
			'zii.widgets.CMenu',
			array(
			'items'=>Yii::app()->chapterMenu,
			'htmlOptions'=>array(),
			)
		);
		$this->endWidget();
		?>
	</div>
</div>

<div class="span-17 last">
	
	<h1>Latest Uploads</h1>

	<?php
	$properties = array(
		'dataProvider'=>$languageDataProvider,
		'itemView'=>'application.views.language._view',
	);
	$this->widget('zii.widgets.CListView', $properties);
	?>

</div>

<div class="clear"></div>
